<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/22
 * Time: 13:13
 */
namespace phpfuntions\mp_math;
//数学计算函数
class myphp_math_calc
{
    /**
     * abs 函数：求绝对值　
     * @access public
     * @return
     */
    public static function abs ($number) {
        return abs( $number);

    }

    /**
     * ceil 函数：进一法取整
     * @access public
     * @return
     */
    public static function ceil ($value) {
        return ceil($value );

    }

    /**
     * floor 函数：舍去法取整
     * @access public
     * @return
     */
    public static function floor ($value) {
        return floor( $value);

    }

    /**
     * fmod 函数：返回除法的浮点数余数
     * @access public
     * @return
     */
    public static function fmod ($x, $y) {
        return fmod($x, $y );

    }

    /**
     * log10 函数：返回以10为底的对数
     * @access public
     * @return
     */
    public static function log10 ($arg) {
        return log10($arg );

    }

    /**
     * log1p 函数：返回log(1+number)　
     * @access public
     * @return
     */
    public static function log1p ($number) {
        return log1p( $number);

    }

    /**
     * log 函数：返回指定数值的(自然)　对数
     * @access public
     * @return
     */
    public static function log ($arg, $base = null) {
        return log($arg, $base = null );

    }

    /**
     * pow 函数：返回指定数值的n次方
     * @access public
     * @return
     */
    public static function pow ($base, $exp) {
        return pow($base, $exp );

    }

    /**
     * round：对浮点数进行四舍五入运算　
     * @access public
     * @return
     */
    public static function round ($val, $precision = 0, $mode = PHP_ROUND_HALF_UP) {
        return round( $val, $precision  , $mode  );

    }

    /**
     * sqrt 函数：返回指定数值的平方根
     * @access public
     * @return
     */
    public static function sqrt ($arg) {
        return sqrt( $arg);

    }
}